home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / CMMComponent.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  11.1 KB  |  388 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        CMMComponent.a
  3. ;
  4. ;    Contains:    ColorSync CMM Component API
  5. ;
  6. ;    Version:    Technology:    ColorSync 2.5
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1994-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__CMMCOMPONENT__') = 'UNDEFINED' THEN
  18. __CMMCOMPONENT__ SET 1
  19.  
  20.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  21.     include 'Quickdraw.a'
  22.     ENDIF
  23.     IF &TYPE('__COMPONENTS__') = 'UNDEFINED' THEN
  24.     include 'Components.a'
  25.     ENDIF
  26.     IF &TYPE('__CMAPPLICATION__') = 'UNDEFINED' THEN
  27.     include 'CMApplication.a'
  28.     ENDIF
  29.  
  30.  
  31. CMMInterfaceVersion                EQU        1
  32. ;  Component function selectors 
  33. ;  Required 
  34.  
  35. kCMMInit                        EQU        0
  36. kNCMMInit                        EQU        6
  37. kCMMMatchColors                    EQU        1
  38. kCMMCheckColors                    EQU        2
  39. ;  Optional 
  40.  
  41. kCMMValidateProfile                EQU        8
  42. kCMMFlattenProfile                EQU        14
  43. kCMMUnflattenProfile            EQU        15
  44. kCMMMatchBitmap                    EQU        9
  45. kCMMCheckBitmap                    EQU        10
  46. kCMMMatchPixMap                    EQU        3
  47. kCMMCheckPixMap                    EQU        4
  48. kCMMConcatenateProfiles            EQU        5
  49. kCMMConcatInit                    EQU        7
  50. kCMMNewLinkProfile                EQU        16
  51. kCMMGetPS2ColorSpace            EQU        11
  52. kCMMGetPS2ColorRenderingIntent    EQU        12
  53. kCMMGetPS2ColorRendering        EQU        13
  54. kCMMGetPS2ColorRenderingVMSize    EQU        17
  55. kCMMGetNamedColorInfo            EQU        70
  56. kCMMGetNamedColorValue            EQU        71
  57. kCMMGetIndNamedColorValue        EQU        72
  58. kCMMGetNamedColorIndex            EQU        73
  59. kCMMGetNamedColorName            EQU        74
  60.  
  61. ;
  62. ; pascal CMError NCMInit(ComponentInstance CMSession, CMProfileRef srcProfile, CMProfileRef dstProfile)
  63. ;
  64.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  65.         Macro
  66.         _NCMInit
  67.             move.l              #$00080006,-(sp)
  68.             moveq               #0,D0
  69.             dc.w                $A82A
  70.         EndM
  71.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  72.         IMPORT_CFM_FUNCTION NCMInit
  73.     ENDIF
  74.  
  75. ;
  76. ; pascal CMError CMInit(ComponentInstance CMSession, CMProfileHandle srcProfile, CMProfileHandle dstProfile)
  77. ;
  78.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  79.         Macro
  80.         _CMInit
  81.             move.l              #$00080000,-(sp)
  82.             moveq               #0,D0
  83.             dc.w                $A82A
  84.         EndM
  85.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  86.         IMPORT_CFM_FUNCTION CMInit
  87.     ENDIF
  88.  
  89. ;
  90. ; pascal CMError CMMatchColors(ComponentInstance CMSession, CMColor *myColors, unsigned long count)
  91. ;
  92.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  93.         Macro
  94.         _CMMatchColors
  95.             move.l              #$00080001,-(sp)
  96.             moveq               #0,D0
  97.             dc.w                $A82A
  98.         EndM
  99.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  100.         IMPORT_CFM_FUNCTION CMMatchColors
  101.     ENDIF
  102.  
  103. ;
  104. ; pascal CMError CMCheckColors(ComponentInstance CMSession, CMColor *myColors, unsigned long count, long *result)
  105. ;
  106.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  107.         Macro
  108.         _CMCheckColors
  109.             move.l              #$000C0002,-(sp)
  110.             moveq               #0,D0
  111.             dc.w                $A82A
  112.         EndM
  113.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  114.         IMPORT_CFM_FUNCTION CMCheckColors
  115.     ENDIF
  116.  
  117.  
  118. ;  Optional functions 
  119. ;
  120. ; pascal CMError CMMValidateProfile(ComponentInstance CMSession, CMProfileRef prof, Boolean *valid)
  121. ;
  122.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  123.         Macro
  124.         _CMMValidateProfile
  125.             move.l              #$00080008,-(sp)
  126.             moveq               #0,D0
  127.             dc.w                $A82A
  128.         EndM
  129.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  130.         IMPORT_CFM_FUNCTION CMMValidateProfile
  131.     ENDIF
  132.  
  133. ;
  134. ; pascal CMError CMMFlattenProfile(ComponentInstance CMSession, CMProfileRef prof, unsigned long flags, CMFlattenUPP proc, void *refCon)
  135. ;
  136.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  137.         Macro
  138.         _CMMFlattenProfile
  139.             move.l              #$0010000E,-(sp)
  140.             moveq               #0,D0
  141.             dc.w                $A82A
  142.         EndM
  143.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  144.         IMPORT_CFM_FUNCTION CMMFlattenProfile
  145.     ENDIF
  146.  
  147. ;
  148. ; pascal CMError CMMUnflattenProfile(ComponentInstance CMSession, FSSpec *resultFileSpec, CMFlattenUPP proc, void *refCon)
  149. ;
  150.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  151.         Macro
  152.         _CMMUnflattenProfile
  153.             move.l              #$000C000F,-(sp)
  154.             moveq               #0,D0
  155.             dc.w                $A82A
  156.         EndM
  157.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  158.         IMPORT_CFM_FUNCTION CMMUnflattenProfile
  159.     ENDIF
  160.  
  161. ;
  162. ; pascal CMError CMMatchBitmap(ComponentInstance CMSession, const CMBitmap *bitmap, CMBitmapCallBackUPP progressProc, void *refCon, CMBitmap *matchedBitmap)
  163. ;
  164.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  165.         Macro
  166.         _CMMatchBitmap
  167.             move.l              #$00100009,-(sp)
  168.             moveq               #0,D0
  169.             dc.w                $A82A
  170.         EndM
  171.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  172.         IMPORT_CFM_FUNCTION CMMatchBitmap
  173.     ENDIF
  174.  
  175. ;
  176. ; pascal CMError CMCheckBitmap(ComponentInstance CMSession, const CMBitmap *bitmap, CMBitmapCallBackUPP progressProc, void *refCon, CMBitmap *resultBitmap)
  177. ;
  178.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  179.         Macro
  180.         _CMCheckBitmap
  181.             move.l              #$0010000A,-(sp)
  182.             moveq               #0,D0
  183.             dc.w                $A82A
  184.         EndM
  185.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  186.         IMPORT_CFM_FUNCTION CMCheckBitmap
  187.     ENDIF
  188.  
  189. ;
  190. ; pascal CMError CMMatchPixMap(ComponentInstance CMSession, PixMap *myPixMap, CMBitmapCallBackUPP progressProc, void *refCon)
  191. ;
  192.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  193.         Macro
  194.         _CMMatchPixMap
  195.             move.l              #$000C0003,-(sp)
  196.             moveq               #0,D0
  197.             dc.w                $A82A
  198.         EndM
  199.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  200.         IMPORT_CFM_FUNCTION CMMatchPixMap
  201.     ENDIF
  202.  
  203. ;
  204. ; pascal CMError CMCheckPixMap(ComponentInstance CMSession, const PixMap *myPixMap, CMBitmapCallBackUPP progressProc, BitMap *myBitMap, void *refCon)
  205. ;
  206.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  207.         Macro
  208.         _CMCheckPixMap
  209.             move.l              #$00100004,-(sp)
  210.             moveq               #0,D0
  211.             dc.w                $A82A
  212.         EndM
  213.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  214.         IMPORT_CFM_FUNCTION CMCheckPixMap
  215.     ENDIF
  216.  
  217. ;
  218. ; pascal CMError CMConcatInit(ComponentInstance CMSession, CMConcatProfileSet *profileSet)
  219. ;
  220.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  221.         Macro
  222.         _CMConcatInit
  223.             move.l              #$00040007,-(sp)
  224.             moveq               #0,D0
  225.             dc.w                $A82A
  226.         EndM
  227.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  228.         IMPORT_CFM_FUNCTION CMConcatInit
  229.     ENDIF
  230.  
  231. ;
  232. ; pascal CMError CMNewLinkProfile(ComponentInstance CMSession, CMProfileRef *prof, const CMProfileLocation *targetLocation, CMConcatProfileSet *profileSet)
  233. ;
  234.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  235.         Macro
  236.         _CMNewLinkProfile
  237.             move.l              #$000C0010,-(sp)
  238.             moveq               #0,D0
  239.             dc.w                $A82A
  240.         EndM
  241.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  242.         IMPORT_CFM_FUNCTION CMNewLinkProfile
  243.     ENDIF
  244.  
  245. ;
  246. ; pascal CMError CMMGetPS2ColorSpace(ComponentInstance CMSession, CMProfileRef srcProf, unsigned long flags, CMFlattenUPP proc, void *refCon)
  247. ;
  248.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  249.         Macro
  250.         _CMMGetPS2ColorSpace
  251.             move.l              #$0010000B,-(sp)
  252.             moveq               #0,D0
  253.             dc.w                $A82A
  254.         EndM
  255.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  256.         IMPORT_CFM_FUNCTION CMMGetPS2ColorSpace
  257.     ENDIF
  258.  
  259. ;
  260. ; pascal CMError CMMGetPS2ColorRenderingIntent(ComponentInstance CMSession, CMProfileRef srcProf, unsigned long flags, CMFlattenUPP proc, void *refCon)
  261. ;
  262.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  263.         Macro
  264.         _CMMGetPS2ColorRenderingIntent
  265.             move.l              #$0010000C,-(sp)
  266.             moveq               #0,D0
  267.             dc.w                $A82A
  268.         EndM
  269.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  270.         IMPORT_CFM_FUNCTION CMMGetPS2ColorRenderingIntent
  271.     ENDIF
  272.  
  273. ;
  274. ; pascal CMError CMMGetPS2ColorRendering(ComponentInstance CMSession, CMProfileRef srcProf, CMProfileRef dstProf, unsigned long flags, CMFlattenUPP proc, void *refCon)
  275. ;
  276.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  277.         Macro
  278.         _CMMGetPS2ColorRendering
  279.             move.l              #$0014000D,-(sp)
  280.             moveq               #0,D0
  281.             dc.w                $A82A
  282.         EndM
  283.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  284.         IMPORT_CFM_FUNCTION CMMGetPS2ColorRendering
  285.     ENDIF
  286.  
  287. ;
  288. ; pascal CMError CMMGetPS2ColorRenderingVMSize(ComponentInstance CMSession, CMProfileRef srcProf, CMProfileRef dstProf, unsigned long *vmSize)
  289. ;
  290.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  291.         Macro
  292.         _CMMGetPS2ColorRenderingVMSize
  293.             move.l              #$000C0011,-(sp)
  294.             moveq               #0,D0
  295.             dc.w                $A82A
  296.         EndM
  297.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  298.         IMPORT_CFM_FUNCTION CMMGetPS2ColorRenderingVMSize
  299.     ENDIF
  300.  
  301. ;
  302. ; pascal CMError CMConcatenateProfiles(ComponentInstance CMSession, CMProfileHandle thru, CMProfileHandle dst, CMProfileHandle *newDst)
  303. ;
  304.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  305.         Macro
  306.         _CMConcatenateProfiles
  307.             move.l              #$000C0005,-(sp)
  308.             moveq               #0,D0
  309.             dc.w                $A82A
  310.         EndM
  311.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  312.         IMPORT_CFM_FUNCTION CMConcatenateProfiles
  313.     ENDIF
  314.  
  315. ;  Named Color functions 
  316. ;
  317. ; pascal CMError CMMGetNamedColorInfo(ComponentInstance CMSession, CMProfileRef srcProf, unsigned long *deviceChannels, OSType *deviceColorSpace, OSType *PCSColorSpace, unsigned long *count, StringPtr prefix, StringPtr suffix)
  318. ;
  319.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  320.         Macro
  321.         _CMMGetNamedColorInfo
  322.             move.l              #$001C0046,-(sp)
  323.             moveq               #0,D0
  324.             dc.w                $A82A
  325.         EndM
  326.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  327.         IMPORT_CFM_FUNCTION CMMGetNamedColorInfo
  328.     ENDIF
  329.  
  330. ;
  331. ; pascal CMError CMMGetNamedColorValue(ComponentInstance CMSession, CMProfileRef prof, StringPtr name, CMColor *deviceColor, CMColor *PCSColor)
  332. ;
  333.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  334.         Macro
  335.         _CMMGetNamedColorValue
  336.             move.l              #$00100047,-(sp)
  337.             moveq               #0,D0
  338.             dc.w                $A82A
  339.         EndM
  340.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  341.         IMPORT_CFM_FUNCTION CMMGetNamedColorValue
  342.     ENDIF
  343.  
  344. ;
  345. ; pascal CMError CMMGetIndNamedColorValue(ComponentInstance CMSession, CMProfileRef prof, unsigned long index, CMColor *deviceColor, CMColor *PCSColor)
  346. ;
  347.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  348.         Macro
  349.         _CMMGetIndNamedColorValue
  350.             move.l              #$00100048,-(sp)
  351.             moveq               #0,D0
  352.             dc.w                $A82A
  353.         EndM
  354.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  355.         IMPORT_CFM_FUNCTION CMMGetIndNamedColorValue
  356.     ENDIF
  357.  
  358. ;
  359. ; pascal CMError CMMGetNamedColorIndex(ComponentInstance CMSession, CMProfileRef prof, StringPtr name, unsigned long *index)
  360. ;
  361.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  362.         Macro
  363.         _CMMGetNamedColorIndex
  364.             move.l              #$000C0049,-(sp)
  365.             moveq               #0,D0
  366.             dc.w                $A82A
  367.         EndM
  368.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  369.         IMPORT_CFM_FUNCTION CMMGetNamedColorIndex
  370.     ENDIF
  371.  
  372. ;
  373. ; pascal CMError CMMGetNamedColorName(ComponentInstance CMSession, CMProfileRef prof, unsigned long index, StringPtr name)
  374. ;
  375.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  376.         Macro
  377.         _CMMGetNamedColorName
  378.             move.l              #$000C004A,-(sp)
  379.             moveq               #0,D0
  380.             dc.w                $A82A
  381.         EndM
  382.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  383.         IMPORT_CFM_FUNCTION CMMGetNamedColorName
  384.     ENDIF
  385.  
  386.     ENDIF ; __CMMCOMPONENT__ 
  387.  
  388.